home *** CD-ROM | disk | FTP | other *** search
/ Aminet 16 / Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso / Aminet / comm / term / term_source.lha / Extras / Source / gtlayout-source.lha / LTP_DrawBackFore.c < prev    next >
C/C++ Source or Header  |  1996-03-18  |  963b  |  50 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1996 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #ifdef DO_TAPEDECK_KIND
  15. VOID
  16. LTP_DrawBackFore(struct RastPort *RPort,BOOL Back,LONG Left,LONG Top,LONG Width,LONG Height)
  17. {
  18.     LONG i,Len,Start,ArrowWidth,ArrowHeight,Shift,x1,x2;
  19.  
  20.     ArrowWidth    = Width / 2;
  21.     ArrowHeight    = Height;
  22.     Left        = Left + (Width - ArrowWidth) / 2;
  23.     Shift        = ArrowWidth / 2;
  24.  
  25.     for(i = 0 ; i < ArrowWidth ; i++)
  26.     {
  27.         Len = ((ArrowHeight * (i + 1)) / ArrowWidth) & ~1;
  28.  
  29.         if(Len < ArrowHeight)
  30.             Len++;
  31.  
  32.         Start = Top + (ArrowHeight - Len) / 2;
  33.  
  34.         if(Back)
  35.         {
  36.             x1 = Left + i - Shift;
  37.             x2 = Left + i + Shift;
  38.         }
  39.         else
  40.         {
  41.             x1 = Left + ArrowWidth - 1 - i - Shift;
  42.             x2 = Left + ArrowWidth - 1 - i + Shift;
  43.         }
  44.  
  45.         LTP_DrawLine(RPort,x1,Start,x1,Start + Len - 1);
  46.         LTP_DrawLine(RPort,x2,Start,x2,Start + Len - 1);
  47.     }
  48. }
  49. #endif    /* DO_TAPEDECK_KIND */
  50.